package cn.mw.controller;

import cn.mw.mapper.BuildMapper;
import cn.mw.service.IBuildService;
import cn.mw.util.JSONResult;
import cn.mw.vo.BuildVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/build")
public class BuildController {
    @Autowired
    private IBuildService buildService;
    @GetMapping("/getDeviceListByBuildId/{id}")
    public JSONResult getDeviceListByBuildId(@PathVariable("id") Long id){
        try {
          BuildVo buildVo=  buildService.getDeviceListByBuildId(id);
          return JSONResult.success(buildVo);
        } catch (Exception e) {
            System.out.println(e.fillInStackTrace());
            return JSONResult.success("操作失败");
        }
    }
}
